class Patient:
    def __init__(self, card_id: str, name: str, age: str, gender: str, phone: str, password: str):
        self._card_id = card_id
        self._name = name
        self._age = age
        self._gender = gender
        self._phone = phone
        self._password = password

    @property
    def card_id(self) -> str:
        """获取患者身份证号"""
        return self._card_id

    @card_id.setter
    def card_id(self, card_id: str):
        """设置患者身份证号"""
        if not isinstance(card_id, str) or len(card_id) != 18:
            raise ValueError("身份证号必须是18位的字符串")
        self._card_id = card_id

    @property
    def name(self) -> str:
        """获取患者姓名"""
        return self._name

    @name.setter
    def name(self, name: str):
        """设置患者姓名"""
        if not isinstance(name, str):
            raise ValueError("姓名必须是字符串")
        self._name = name

    @property
    def age(self) -> str:
        """获取患者年龄"""
        return self._age

    @age.setter
    def age(self, age: str):
        """设置患者年龄"""
        if not isinstance(int(age), int) or int(age) < 0:
            raise ValueError("年龄必须是非负整数")
        self._age = age

    @property
    def gender(self) -> str:
        """获取患者性别"""
        return self._gender

    @gender.setter
    def gender(self, gender: str):
        """设置患者性别"""
        if gender not in ['男', '女']:
            raise ValueError("性别必须是'男'或'女'")
        self._gender = gender

    @property
    def phone(self) -> str:
        """获取患者联系方式"""
        return self._phone

    @phone.setter
    def phone(self, phone: str):
        """设置患者联系方式"""
        if not isinstance(phone, str):
            raise ValueError("联系方式必须是字符串")
        self._phone = phone

    @property
    def password(self) -> str:
        """获取患者密码"""
        return self._password

    @password.setter
    def password(self, password: str):
        """设置患者密码"""
        self._password = password

    def get_info(self) -> str:
        """获取患者信息的字符串表示"""
        return f"患者姓名：{self._name}，患者年龄：{self._age}，患者性别：{self._gender}，患者联系方式：{self._phone}，身份证号：{self._card_id},密码：{self._password} "

    def print_info(self):
        """打印患者信息"""
        print(f"患者姓名：{self._name}，患者年龄：{self._age}，患者性别：{self._gender}，患者联系方式：{self._phone}，身份证号：{self._card_id},密码：{self._password}")
